<template>
  <router-view #="{ Component }">
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<script>
import { defineComponent } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { setLocations } from './utils/storage'

export default defineComponent({
  name: 'App',
  setup() {
    const router = useRouter()
    const route = useRoute()
    router.isReady().then(() => {
      const enterType = route.query.enterType || ''
      if (enterType) {
        setLocations('enterType', enterType)
      }
    })

    return {}
  }
})
</script>

<style lang="less">
  html {
    font-size: 16px;
  }
</style>
